<template>
	<view class="item-container" hover-class="item-container-hover">
		<view class="header">
			<image src="../../static/icon_music.png" style="width: 16px; height: 16px;"></image>
			<text class="name">{{music.name}}</text>
			<image v-if="playing" src="../../static/wave.gif" style="width: 16px; height: 16px;"></image>
		</view>
		<text class="content">{{music.content}}</text>
	</view>
</template>

<script setup>
	defineProps({
		music: Object,
		playing: {
			type: Boolean,
			default: function() {
				return false;
			}
		}
	})
</script>

<style lang="scss" scoped>
	.item-container {
		background: white;
		border-radius: 8px;
		display: flex;
		flex-direction: column;
		padding: 12px;
		row-gap: 12px;

		.header {
			display: flex;
			flex-direction: row;
			column-gap: 8px;
			align-items: center;

			.name {
				flex: 1;
				width: 1;
				color: #222;
				font-size: 16px;
			}
		}

		.content {
			color: #444;
			font-size: 14px;
		}
	}

	.item-container-hover {
		background: $uni-bg-color-hover;
	}
</style>
